package gxprod.androidai.widgets;

import gxprod.androidai.AIActivity;
import gxprod.androidai.functions.OrganizationFunction.Event;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.widget.ListView;

public class EventListWidget extends Widget {
	
	public ListView list;
	public EventAdapter adapter;
	
	public EventListWidget(Context context, List<Event> events) {
		super(context);

		list = new ListView(context);
		adapter = new EventAdapter((AIActivity) context);
		list.setAdapter(adapter);
		
		if(events != null)
			for(int i = 0; i < events.size(); i++)
				adapter.addItem(events.get(i));
	}

	@Override
	public View getTopLevelView() { return list; }
}
